/*##############################
# JQUERY LOADING
##############################*/
function jquery_loading() 
{
	$(_loadingLayer).show().fadeOut('slow');
}
/*##############################
# ShowHide Function
##############################*/
function do_ShowHide(cssParent, cssChildren)
{
	var checked = $(cssParent).is(':checked');
	if (checked) $(cssChildren).show();
	else $(cssChildren).hide();
}
/*##############################
# Checkbox Function
##############################*/
function do_checkbox(cssParent, cssChildren)
{
	var checked_status = $(cssParent).is(':checked');
	$(cssChildren).each(function()
	{
	   this.checked = checked_status;
	});
}
/*##############################
# Search Function
##############################*/
function do_search() 
{
	keyword = encodeURIComponent($('#search_keyword').val());
	type = $('#search_module').val();
	if (keyword) window.location.href = _websiteUrl+'?do='+type+'&keyword='+keyword;
	return false;
}
/*##############################
# Logout Function
##############################*/
function do_logout()
{
	$.get
	(
	       _websiteUrl,
		   {
			    logout: true
		   },
		   function(data)
		   {
			   jquery_loading();
			   window.location = _websiteUrl;
		   }
	);
   return false;
}
/*##############################
# Logout Function
##############################*/
function do_login()
{
	if ($('#user_remember').is(':checked')) remember_value = 1;
	else remember_value = 0;
	$.post
	(
	       _websiteUrl,
		   {
			    login: true,
				user_name: $('#user_name').val(),
				user_pwd: $('#user_pwd').val(),
				user_remember: remember_value
		   },
		   function(data)
		   {
			   var login_html_data = eval('('+data+')');
			   $('.message').html(login_html_data.language).css({color : '#900'});
			   jquery_loading();
			   if (login_html_data.value)
			   {
				   window.location = _currentUrl;
			   }
		   }
	);
   return false;
}
/*##############################
# Captcha Refresh Function
##############################*/
function do_captcha_refresh(varCSS, varUrl)
{
	var captcha = $(varCSS);
    var a = new Date();
    var ms = a.getMilliseconds();
    var s = a.getSeconds();
    var mn = a.getMinutes();
    var h = a.getHours();
    var d = a.getDay();
    var m = a.getMonth();
    var y = a.getFullYear();
    var t = y+'.'+m+'.'+d+'-'+h+':'+mn+':'+s+':'+ms;
	captcha.attr('src', varUrl+'&ts='+t);
	jquery_loading();
    return false;
}